<%--
  Created by IntelliJ IDEA.
  User: imfeijiu
  Date: 2019/5/27
  Time: 8:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="/static/js/jquery-1.8.3.min.js"></script>
    <script src="/static/js/echarts.min.js"></script>
    <title>Title</title>
</head>
<body>
<div id="echarts" style="height: 500px;width: 300px;"></div>
<form action="/hh/updata" method="get">
    <label>名称： <input name="name" type="text"/></label>
    <label>年龄： <input name="age" type="text"/></label>
    <input type="submit" value="提交">
</form>
<button id="button1">点击测试</button>
<p>
    <input type="text" id="value1" placeholder="名称">
    <input type="text" id="value2" placeholder="年龄">
    <button type="button" id="button2">提交</button>
</p>
<button type="button" id="add">加一</button>
${hello2}
<script>
    $("#add").click(function () {
        var a=option.series[0].data[0];
        a++;
        option.series[0].data[0]=a;
        mycharts.setOption(option)
        console.log(a)
    })
    var mycharts=echarts.init(document.getElementById('echarts'));
    var option = {
        title: {
            text: 'ECharts 入门示例'
        },
        tooltip: {},
        legend: {
            data:['销量']
        },
        xAxis: {
            data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
        },
        yAxis: {},
        series: [{
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
        }]
    };
    mycharts.setOption(option);

    $("#button2").click(function () {
        console.log("提交ajax")
        var nname = $("#value1");
        var aage = $("#value2");
        $.get("/hh/testPerson", {
            age: aage.val(),
            name: nname.val()
        },function () {
            aage.val(null)
            nname.val(null)
        })
    })
    $("#button1").click(function () {
        console.log("jqery测试")
    })
</script>
</body>
</html>
